/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojs/ojdvt-base","ojs/internal-deps/dvt/DvtGauge"],function(a,g,b,c,d){a.Ra("oj.dvtBaseGauge",g.oj.dvtBaseComponent,{KH:function(){this._super();this.options._thresholdColors=[this.options._threshold1,this.options._threshold2,this.options._threshold3];this.options._threshold1=null;this.options._threshold2=null;this.options._threshold3=null},Nh:function(){this._super();this.option("rawValue",this.options.value,{_context:{Cd:!0,kb:!0,readOnly:!0}})},
Ej:function(){var a=this._super();a["oj-gauge-metric-label"]={path:"metricLabel/style",property:"CSS_TEXT_PROPERTIES"};a["oj-gauge-tick-label"]={path:"tickLabel/style",property:"CSS_TEXT_PROPERTIES"};a["oj-gauge-threshold1"]={path:"_threshold1",property:"color"};a["oj-gauge-threshold2"]={path:"_threshold2",property:"color"};a["oj-gauge-threshold3"]={path:"_threshold3",property:"color"};return a},Fj:function(){return["input","optionChange"]},Ti:function(){var a=this.options.translations,b=this._super();
b["DvtGaugeBundle.EMPTY_TEXT"]=a.labelNoData;b["DvtUtilBundle.GAUGE"]=a.componentName;return b},El:function(a){if("valueChange"===a.type){var b=a.newValue;a.complete?this.fe("value",b):(this._trigger("input",null,{value:b}),this.fe("rawValue",b))}else this._super(a)},_setOption:function(b,c,d){"rawValue"===b?a.t.error("'rawValue' is a read-only option and cannot be set"):("value"===b&&this.option("rawValue",c,{_context:{Cd:!0,kb:!0,readOnly:!0}}),this._super(b,c,d))},Hk:function(a){var b=a.subId;
if("oj-dialgauge-tooltip"==b||"oj-ledgauge-tooltip"==b||"oj-ratinggauge-tooltip"==b||"oj-statusmetergauge-tooltip"==b)b="tooltip";"oj-ratinggauge-item"==b&&null!=a.index&&(b="item["+a.index+"]");return b}},!0);a.Ra("oj.ojLedGauge",g.oj.dvtBaseGauge,{widgetEventPrefix:"oj",options:{},Dg:function(a,b,c){this._focusable({element:this.element,applyHighlight:!0});return d.LedGauge.newInstance(a,b,c)},Oh:function(a){var b={};"tooltip"==a&&(b.subId="oj-ledgauge-tooltip");return b},Jf:function(){var a=this._super();
a.push("oj-ledgauge");return a},Sh:function(){this.element.attr("title")?(this.options.shortDesc=this.element.attr("title"),this.element.data(this.element,"title",this.element.attr("title")),this.element.removeAttr("title")):this.element.data("title")&&(this.options.shortDesc=this.element.data("title"));this._super()},getMetricLabel:function(){return this.xa.getAutomation().getMetricLabel()}});a.Ra("oj.ojRatingGauge",g.oj.dvtBaseGauge,{widgetEventPrefix:"oj",options:{input:null,optionChange:null,
rawValue:void 0},Dg:function(a,b,c){this._focusable({element:this.element,applyHighlight:!0});return d.RatingGauge.newInstance(a,b,c)},Oh:function(a){var b={};"tooltip"==a?b.subId="oj-ratinggauge-tooltip":0==a.indexOf("item")&&(b.subId="oj-ratinggauge-item",b.index=this.Jk(a));return b},Jf:function(){var a=this._super();a.push("oj-ratinggauge");return a},Sh:function(){this.element.attr("title")?(this.options.shortDesc=this.element.attr("title"),this.element.data(this.element,"title",this.element.attr("title")),
this.element.removeAttr("title")):this.element.data("title")&&(this.options.shortDesc=this.element.data("title"));this._super()},fe:function(a,b){this._superApply(arguments);"value"==a&&this.fe("changed",!0)}});a.Ra("oj.ojDialGauge",g.oj.dvtBaseGauge,{widgetEventPrefix:"oj",options:{input:null,optionChange:null,rawValue:void 0},Dg:function(a,b,c){this._focusable({element:this.element,applyHighlight:!0});return d.DialGauge.newInstance(a,b,c)},Oh:function(a){var b={};"tooltip"==a&&(b.subId="oj-dialgauge-tooltip");
return b},Jf:function(){var a=this._super();a.push("oj-dialgauge");return a},Sh:function(){this.element.attr("title")?(this.options.shortDesc=this.element.attr("title"),this.element.data(this.element,"title",this.element.attr("title")),this.element.removeAttr("title")):this.element.data("title")&&(this.options.shortDesc=this.element.data("title"));this.RDa();this._super()},RDa:function(){var b=this.options.background;null==b&&(b="circleAlta",this.options.background="circleAlta");var c=this.options.indicator;
null==c&&(c="needleAlta",this.options.indicator="needleAlta");if("string"===typeof b){var d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-circle-200x200.png"),width:200,height:200},{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-circle-400x400.png"),width:400,height:400}];"rectangleAlta"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-rectangle-200x200.png"),width:200,height:154},{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-rectangle-400x400.png"),width:400,height:309}]:
"domeAlta"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-dome-200x200.png"),width:200,height:154},{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-dome-400x400.png"),width:400,height:309}]:"circleAntique"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-circle-200x200.png"),width:200,height:200},{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-circle-400x400.png"),width:400,height:400}]:"rectangleAntique"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-rectangle-200x200.png"),
width:200,height:168},{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-rectangle-400x400.png"),width:400,height:335}]:"domeAntique"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-dome-200x200.png"),width:200,height:176},{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-dome-400x400.png"),width:400,height:352}]:"circleLight"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-circle-200x200.png"),width:200,height:200},{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-circle-400x400.png"),
width:400,height:400}]:"rectangleLight"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-rectangle-200x200.png"),width:200,height:154},{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-rectangle-400x400.png"),width:400,height:307}]:"domeLight"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-dome-200x200.png"),width:200,height:138},{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-dome-400x400.png"),width:400,height:276}]:"circleDark"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-circle-200x200.png"),
width:200,height:200},{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-circle-400x400.png"),width:400,height:400}]:"rectangleDark"===b?d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-rectangle-200x200.png"),width:200,height:154},{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-rectangle-400x400.png"),width:400,height:307}]:"domeDark"===b&&(d=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-dome-200x200.png"),width:200,height:138},{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-dome-400x400.png"),
width:400,height:276}]);this.options._backgroundImages=d}"string"===typeof c&&(b=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/alta-needle-1600x1600.png"),width:374,height:575}],"needleAntique"===c?b=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/antique-needle-1600x1600.png"),width:81,height:734}]:"needleDark"===c?b=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/dark-needle-1600x1600.png"),width:454,height:652}]:"needleLight"===c&&(b=[{src:a.fa.gb("resources/internal-deps/dvt/gauge/light-needle-1600x1600.png"),
width:454,height:652}]),this.options._indicatorImages=b)},getMetricLabel:function(){return this.xa.getAutomation().getMetricLabel()}});a.Ra("oj.ojStatusMeterGauge",g.oj.dvtBaseGauge,{widgetEventPrefix:"oj",options:{input:null,optionChange:null,rawValue:void 0},Dg:function(a,b,c){this._focusable({element:this.element,applyHighlight:!0});return d.StatusMeterGauge.newInstance(a,b,c)},Oh:function(a){var b={};"tooltip"==a&&(b.subId="oj-statusmetergauge-tooltip");return b},Jf:function(){var a=this._super();
a.push("oj-statusmetergauge");return a},Sh:function(){this.element.attr("title")?(this.options.shortDesc=this.element.attr("title"),this.element.data(this.element,"title",this.element.attr("title")),this.element.removeAttr("title")):this.element.data("title")&&(this.options.shortDesc=this.element.data("title"));this._super()},getMetricLabel:function(){return this.xa.getAutomation().getMetricLabel()}});a.Components.Xa("dvtBaseGauge","dvtBaseComponent",{properties:{},methods:{},extension:{_widgetName:"dvtBaseGauge"}});
a.Components.Xa("ojDialGauge","dvtBaseGauge",{properties:{animationDuration:{type:"number"},animationOnDataChange:{type:"string"},animationOnDisplay:{type:"string"},background:{type:"object|string"},indicator:{type:"object|string"},max:{type:"number"},metricLabel:{type:"object"},min:{type:"number"},rawValue:{type:"number",readOnly:!0,writeback:!0},readOnly:{type:"boolean"},tickLabel:{type:"object"},tooltip:{type:"object"},value:{type:"number",writeback:!0}},methods:{getMetricLabel:{}},extension:{_widgetName:"ojDialGauge"}});
a.Components.register("oj-dial-gauge",a.Components.getMetadata("ojDialGauge"));a.Components.Xa("ojLedGauge","dvtBaseGauge",{properties:{borderColor:{type:"string"},className:{type:"string"},color:{type:"string"},max:{type:"number"},metricLabel:{type:"object"},min:{type:"number"},rotation:{type:"number"},size:{type:"number"},style:{type:"object"},thresholds:{type:"Array\x3cobject\x3e"},title:{type:"object"},tooltip:{type:"object"},type:{type:"string"},value:{type:"number",writeback:!0},visualEffects:{type:"string"}},
methods:{getMetricLabel:{}},extension:{_widgetName:"ojLedGauge"}});a.Components.register("oj-led-gauge",a.Components.getMetadata("ojLedGauge"));a.Components.Xa("ojRatingGauge","dvtBaseGauge",{properties:{changed:{type:"boolean"},changedState:{type:"object"},hoverState:{type:"object"},max:{type:"number"},min:{type:"number"},orientation:{type:"string"},preserveAspectRatio:{type:"string"},rawValue:{type:"number",readOnly:!0,writeback:!0},readOnly:{type:"boolean"},selectedState:{type:"object"},step:{type:"number"},
thresholds:{type:"Array\x3cobject\x3e"},tooltip:{type:"object"},unselectedState:{type:"object"},value:{type:"number",writeback:!0},visualEffects:{type:"string"}},methods:{},extension:{_widgetName:"ojRatingGauge"}});a.Components.register("oj-rating-gauge",a.Components.getMetadata("ojRatingGauge"));a.Components.Xa("ojStatusMeterGauge","dvtBaseGauge",{properties:{angleExtent:{type:"number"},animationDuration:{type:"number"},animationOnDataChange:{type:"string"},animationOnDisplay:{type:"string"},borderColor:{type:"string"},
borderRadius:{type:"string"},center:{type:"object"},className:{type:"string"},color:{type:"string"},indicatorSize:{type:"number"},innerRadius:{type:"number"},max:{type:"number"},metricLabel:{type:"object"},min:{type:"number"},orientation:{type:"string"},plotArea:{type:"object"},rawValue:{type:"number",readOnly:!0,writeback:!0},readOnly:{type:"boolean"},referenceLines:{type:"Array\x3cobject\x3e"},startAngle:{type:"number"},step:{type:"number"},style:{type:"object"},thresholdDisplay:{type:"string"},
thresholds:{type:"Array\x3cobject\x3e"},title:{type:"object"},tooltip:{type:"object"},value:{type:"number",writeback:!0},visualEffects:{type:"string"}},methods:{getMetricLabel:{}},extension:{_widgetName:"ojStatusMeterGauge"}});a.Components.register("oj-status-meter-gauge",a.Components.getMetadata("ojStatusMeterGauge"))});